import request from "@/utils/request";

/**
* 刷单表数据
*
* @param queryParams
*/
export function getSysOrderPage(queryParams) {
    return request({
        url: '/api/v1/order/page',
        method: 'get',
        params: queryParams
    });
}


/**
* 获取刷单表表单数据
*
* @param queryParams
*/
export function getSysOrderForm(id) {
    return request({
        url: '/api/v1/order/' + id + '/form',
        method: 'get'
    });
}

/**
* 保存刷单表
*
* @param data
*/
export function saveSysOrder(data) {
    return request({
        url: "/api/v1/order",
        method: "post",
        data: data,
    });
}

/**
* 删除刷单表
*
* @param ids
*/
export function deleteSysOrder(ids) {
    return request({
        url: '/api/v1/order/' + ids,
        method: 'delete'
    });
}

/**
* 导入刷单表
*
* @param file
*/
export function importSysOrder(file: any) {
    const formData = new FormData();
    formData.append('file', file);
    return request({
        url: '/api/v1/order/sysOrderImport',
        method: 'post',
        data: formData,
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    });
}

/**
* 导出刷单表
*
* @param ids
* @returns
*/
export function exportSysOrder(ids: any) {
    return request({
        url: '/api/v1/order/_export?ids='+ids,
        method: 'get',
        responseType: 'arraybuffer'
    });
}